home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / Balloons.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  13.1 KB  |  417 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Balloons.a
  3. ;
  4. ;    Contains:    Balloon Help Package Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.0
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1990-1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__BALLOONS__') = 'UNDEFINED' THEN
  18. __BALLOONS__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  24.     include 'Quickdraw.a'
  25.     ENDIF
  26.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  27.     include 'Menus.a'
  28.     ENDIF
  29.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  30.     include 'TextEdit.a'
  31.     ENDIF
  32.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  33.     include 'Errors.a'
  34.     ENDIF
  35.  
  36.  
  37. ;  • constants
  38.  
  39.  
  40. kTopLeftTipPointsLeftVariant    EQU        0
  41. kTopLeftTipPointsUpVariant        EQU        1
  42. kTopRightTipPointsUpVariant        EQU        2
  43. kTopRightTipPointsRightVariant    EQU        3
  44. kBottomRightTipPointsRightVariant EQU    4
  45. kBottomRightTipPointsDownVariant EQU    5
  46. kBottomLeftTipPointsDownVariant    EQU        6
  47. kBottomLeftTipPointsLeftVariant    EQU        7
  48. kBalloonVariantCount            EQU        8
  49. ; typedef SInt16                         BalloonVariant
  50.  
  51.  
  52. hmBalloonHelpVersion            EQU        $0002                ; The real version of the Help Manager 
  53. kHMHelpMenuID                    EQU        -16490                ; Resource ID and menu ID of help menu 
  54. kHMAboutHelpItem                EQU        1                    ; help menu item number of About Balloon Help… 
  55. kHMShowBalloonsItem                EQU        3                    ; help menu item number of Show/Hide Balloons 
  56. kHMHelpID                        EQU        -5696                ; ID of various Help Mgr package resources (in Pack14 range) 
  57. kBalloonWDEFID                    EQU        126                    ; Resource ID of the WDEF proc used in standard balloons 
  58.  
  59.                                                             ; Dialog item template type constant 
  60. helpItem                        EQU        1                    ; key value in DITL template that corresponds to the help item 
  61.  
  62.                                                             ; Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources 
  63. hmDefaultOptions                EQU        0                    ; default options for help manager resources 
  64. hmUseSubID                        EQU        1                    ; treat resID's in resources as subID's of driver base ID (for Desk Accessories) 
  65. hmAbsoluteCoords                EQU        2                    ; ignore window port origin and treat rectangles as absolute coords (local to window) 
  66.  
  67. hmSaveBitsNoWindow                EQU        4                    ; don't create a window, just blast bits on screen. No update event is generated 
  68. hmSaveBitsWindow                EQU        8                    ; create a window, but restore bits behind window when window goes away & generate update event 
  69. hmMatchInTitle                    EQU        16                    ; for hwin resources, match string anywhere in window title string 
  70.  
  71.                                                             ; Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources 
  72. kHMStringItem                    EQU        1                    ; pstring used in resource 
  73. kHMPictItem                        EQU        2                    ; 'PICT' ResID used in resource 
  74. kHMStringResItem                EQU        3                    ; 'STR#' ResID & index used in resource 
  75. kHMTEResItem                    EQU        6                    ; Styled Text Edit ResID used in resource ('TEXT' & 'styl') 
  76. kHMSTRResItem                    EQU        7                    ; 'STR ' ResID used in resource 
  77. kHMSkipItem                        EQU        256                    ; don't display a balloon 
  78. kHMCompareItem                    EQU        512                    ; Compare pstring in menu item w/ PString in resource item ('hmnu' only) 
  79. kHMNamedResourceItem            EQU        1024                ; Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) 
  80. kHMTrackCntlItem                EQU        2048                ; Reserved 
  81.  
  82.                                                             ; Constants for hmmHelpType's when filling out HMMessageRecord 
  83. khmmString                        EQU        1                    ; help message contains a PString 
  84. khmmPict                        EQU        2                    ; help message contains a resource ID to a 'PICT' resource 
  85. khmmStringRes                    EQU        3                    ; help message contains a res ID & index to a 'STR#' resource 
  86. khmmTEHandle                    EQU        4                    ; help message contains a Text Edit handle 
  87. khmmPictHandle                    EQU        5                    ; help message contains a Picture handle 
  88. khmmTERes                        EQU        6                    ; help message contains a res ID to 'TEXT' & 'styl' resources 
  89. khmmSTRRes                        EQU        7                    ; help message contains a res ID to a 'STR ' resource 
  90. kHMEnabledItem                    EQU        0                    ; item is enabled, but not checked or control value = 0 
  91.  
  92.                                                             ; ResTypes for Styled TE Handles in Resources 
  93. kHMTETextResType                EQU        'TEXT'                ; Resource Type of text data for styled TE record w/o style info 
  94. kHMTEStyleResType                EQU        'styl'                ; Resource Type of style information for styled TE record 
  95.  
  96. kHMDisabledItem                    EQU        1                    ; item is disabled, grayed in menus or disabled in dialogs 
  97. kHMCheckedItem                    EQU        2                    ; item is enabled, and checked or control value = 1 
  98. kHMOtherItem                    EQU        3                    ; item is enabled, and control value > 1 
  99.                                                             ; Method parameters to pass to HMShowBalloon 
  100. kHMRegularWindow                EQU        0                    ; Create a regular window floating above all windows 
  101. kHMSaveBitsNoWindow                EQU        1                    ; Just save the bits and draw (for MDEF calls) 
  102. kHMSaveBitsWindow                EQU        2                    ; Regular window, save bits behind, AND generate update event 
  103.  
  104.                                                             ; Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages 
  105. kHMMenuResType                    EQU        'hmnu'                ; ResType of help resource for supporting menus 
  106. kHMDialogResType                EQU        'hdlg'                ; ResType of help resource for supporting dialogs 
  107. kHMWindListResType                EQU        'hwin'                ; ResType of help resource for supporting windows 
  108. kHMRectListResType                EQU        'hrct'                ; ResType of help resource for rectangles in windows 
  109. kHMOverrideResType                EQU        'hovr'                ; ResType of help resource for overriding system balloons 
  110. kHMFinderApplResType            EQU        'hfdr'                ; ResType of help resource for custom balloon in Finder 
  111. HMStringResType            RECORD 0
  112. hmmResID                 ds.w    1                ; offset: $0 (0)
  113. hmmIndex                 ds.w    1                ; offset: $2 (2)
  114. sizeof                     EQU *                    ; size:   $4 (4)
  115.                         ENDR
  116. HMMessageRecord            RECORD 0
  117. hmmHelpType                 ds.w    1                ; offset: $0 (0)
  118. hmmString                 ds        Str255            ; offset: $2 (2)
  119.                          ORG 2
  120. hmmPict                     ds.w    1                ; offset: $2 (2)
  121.                          ORG 2
  122. hmmTEHandle                 ds.l    1                ; offset: $2 (2)
  123.                          ORG 2
  124. hmmStringRes             ds        HMStringResType ; offset: $2 (2)
  125.                          ORG 2
  126. hmmPictRes                 ds.w    1                ; offset: $2 (2)
  127.                          ORG 2
  128. hmmPictHandle             ds.l    1                ; offset: $2 (2)
  129.                          ORG 2
  130. hmmTERes                 ds.w    1                ; offset: $2 (2)
  131.                          ORG 2
  132. hmmSTRRes                 ds.w    1                ; offset: $2 (2)
  133.                          ORG 258
  134. sizeof                     EQU *                    ; size:   $102 (258)
  135.                         ENDR
  136. ; typedef struct HMMessageRecord *        HMMessageRecPtr
  137.  
  138. ;   Public Interfaces  
  139. ;
  140. ; pascal OSErr HMGetHelpMenuHandle(MenuHandle *mh)
  141. ;
  142.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  143.         Macro
  144.         _HMGetHelpMenuHandle
  145.             move.w              #$0200,D0
  146.             dc.w                $A830
  147.         EndM
  148.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  149.         IMPORT_CFM_FUNCTION HMGetHelpMenuHandle
  150.     ENDIF
  151.  
  152. ;
  153. ; pascal OSErr HMShowBalloon(const HMMessageRecord *inHelpMessage, Point inTip, Rect *inHotRect, TipFunctionUPP inTipProc, SInt16 inWindowProcID, BalloonVariant inBalloonVariant, SInt16 inMethod)
  154. ;
  155.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  156.         Macro
  157.         _HMShowBalloon
  158.             move.w              #$0B01,D0
  159.             dc.w                $A830
  160.         EndM
  161.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  162.         IMPORT_CFM_FUNCTION HMShowBalloon
  163.     ENDIF
  164.  
  165. ;
  166. ; pascal OSErr HMShowMenuBalloon(SInt16 itemNum, SInt16 itemMenuID, SInt32 itemFlags, SInt32 itemReserved, Point tip, Rect *alternateRect, TipFunctionUPP tipProc, SInt16 theProc, BalloonVariant balloonVariant)
  167. ;
  168.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  169.         Macro
  170.         _HMShowMenuBalloon
  171.             move.w              #$0E05,D0
  172.             dc.w                $A830
  173.         EndM
  174.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  175.         IMPORT_CFM_FUNCTION HMShowMenuBalloon
  176.     ENDIF
  177.  
  178. ;
  179. ; pascal OSErr HMRemoveBalloon(void )
  180. ;
  181.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  182.         Macro
  183.         _HMRemoveBalloon
  184.             move.w              #$0002,D0
  185.             dc.w                $A830
  186.         EndM
  187.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  188.         IMPORT_CFM_FUNCTION HMRemoveBalloon
  189.     ENDIF
  190.  
  191. ;
  192. ; pascal OSErr HMGetIndHelpMsg(ResType inWhichResType, SInt16 inWhichResID, SInt16 inMessageIndex, SInt16 inMessageState, UInt32 *outOptions, Point *outTip, Rect *outHotRect, SInt16 *outWindowProcID, BalloonVariant *outBalloonVariant, HMMessageRecord *outHelpMessage, SInt16 *outMessageCount)
  193. ;
  194.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  195.         Macro
  196.         _HMGetIndHelpMsg
  197.             move.w              #$1306,D0
  198.             dc.w                $A830
  199.         EndM
  200.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  201.         IMPORT_CFM_FUNCTION HMGetIndHelpMsg
  202.     ENDIF
  203.  
  204. ;
  205. ; pascal Boolean HMIsBalloon(void )
  206. ;
  207.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  208.         Macro
  209.         _HMIsBalloon
  210.             move.w              #$0007,D0
  211.             dc.w                $A830
  212.         EndM
  213.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  214.         IMPORT_CFM_FUNCTION HMIsBalloon
  215.     ENDIF
  216.  
  217. ;
  218. ; pascal Boolean HMGetBalloons(void )
  219. ;
  220.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  221.         Macro
  222.         _HMGetBalloons
  223.             move.w              #$0003,D0
  224.             dc.w                $A830
  225.         EndM
  226.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  227.         IMPORT_CFM_FUNCTION HMGetBalloons
  228.     ENDIF
  229.  
  230. ;
  231. ; pascal OSErr HMSetBalloons(Boolean flag)
  232. ;
  233.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  234.         Macro
  235.         _HMSetBalloons
  236.             move.w              #$0104,D0
  237.             dc.w                $A830
  238.         EndM
  239.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  240.         IMPORT_CFM_FUNCTION HMSetBalloons
  241.     ENDIF
  242.  
  243. ;
  244. ; pascal OSErr HMSetFont(SInt16 font)
  245. ;
  246.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  247.         Macro
  248.         _HMSetFont
  249.             move.w              #$0108,D0
  250.             dc.w                $A830
  251.         EndM
  252.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  253.         IMPORT_CFM_FUNCTION HMSetFont
  254.     ENDIF
  255.  
  256. ;
  257. ; pascal OSErr HMSetFontSize(UInt16 fontSize)
  258. ;
  259.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  260.         Macro
  261.         _HMSetFontSize
  262.             move.w              #$0109,D0
  263.             dc.w                $A830
  264.         EndM
  265.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  266.         IMPORT_CFM_FUNCTION HMSetFontSize
  267.     ENDIF
  268.  
  269. ;
  270. ; pascal OSErr HMGetFont(SInt16 *font)
  271. ;
  272.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  273.         Macro
  274.         _HMGetFont
  275.             move.w              #$020A,D0
  276.             dc.w                $A830
  277.         EndM
  278.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  279.         IMPORT_CFM_FUNCTION HMGetFont
  280.     ENDIF
  281.  
  282. ;
  283. ; pascal OSErr HMGetFontSize(UInt16 *fontSize)
  284. ;
  285.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  286.         Macro
  287.         _HMGetFontSize
  288.             move.w              #$020B,D0
  289.             dc.w                $A830
  290.         EndM
  291.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  292.         IMPORT_CFM_FUNCTION HMGetFontSize
  293.     ENDIF
  294.  
  295. ;
  296. ; pascal OSErr HMSetDialogResID(SInt16 resID)
  297. ;
  298.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  299.         Macro
  300.         _HMSetDialogResID
  301.             move.w              #$010C,D0
  302.             dc.w                $A830
  303.         EndM
  304.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  305.         IMPORT_CFM_FUNCTION HMSetDialogResID
  306.     ENDIF
  307.  
  308. ;
  309. ; pascal OSErr HMSetMenuResID(SInt16 menuID, SInt16 resID)
  310. ;
  311.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  312.         Macro
  313.         _HMSetMenuResID
  314.             move.w              #$020D,D0
  315.             dc.w                $A830
  316.         EndM
  317.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  318.         IMPORT_CFM_FUNCTION HMSetMenuResID
  319.     ENDIF
  320.  
  321. ;
  322. ; pascal OSErr HMBalloonRect(const HMMessageRecord *inMessage, Rect *outRect)
  323. ;
  324.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  325.         Macro
  326.         _HMBalloonRect
  327.             move.w              #$040E,D0
  328.             dc.w                $A830
  329.         EndM
  330.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  331.         IMPORT_CFM_FUNCTION HMBalloonRect
  332.     ENDIF
  333.  
  334. ;
  335. ; pascal OSErr HMBalloonPict(const HMMessageRecord *inMessage, PicHandle *outPict)
  336. ;
  337.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  338.         Macro
  339.         _HMBalloonPict
  340.             move.w              #$040F,D0
  341.             dc.w                $A830
  342.         EndM
  343.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  344.         IMPORT_CFM_FUNCTION HMBalloonPict
  345.     ENDIF
  346.  
  347. ;
  348. ; pascal OSErr HMScanTemplateItems(SInt16 whichID, SInt16 whichResFile, ResType whichType)
  349. ;
  350.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  351.         Macro
  352.         _HMScanTemplateItems
  353.             move.w              #$0410,D0
  354.             dc.w                $A830
  355.         EndM
  356.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  357.         IMPORT_CFM_FUNCTION HMScanTemplateItems
  358.     ENDIF
  359.  
  360. ;
  361. ; pascal OSErr HMExtractHelpMsg(ResType inType, SInt16 inResID, SInt16 inMessageIndex, SInt16 inMessageState, HMMessageRecord *outMessage)
  362. ;
  363.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  364.         Macro
  365.         _HMExtractHelpMsg
  366.             move.w              #$0711,D0
  367.             dc.w                $A830
  368.         EndM
  369.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  370.         IMPORT_CFM_FUNCTION HMExtractHelpMsg
  371.     ENDIF
  372.  
  373. ;
  374. ; pascal OSErr HMGetDialogResID(SInt16 *resID)
  375. ;
  376.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  377.         Macro
  378.         _HMGetDialogResID
  379.             move.w              #$0213,D0
  380.             dc.w                $A830
  381.         EndM
  382.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  383.         IMPORT_CFM_FUNCTION HMGetDialogResID
  384.     ENDIF
  385.  
  386. ;
  387. ; pascal OSErr HMGetMenuResID(SInt16 menuID, SInt16 *resID)
  388. ;
  389.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  390.         Macro
  391.         _HMGetMenuResID
  392.             move.w              #$0314,D0
  393.             dc.w                $A830
  394.         EndM
  395.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  396.         IMPORT_CFM_FUNCTION HMGetMenuResID
  397.     ENDIF
  398.  
  399. ;
  400. ; pascal OSErr HMGetBalloonWindow(WindowPtr *window)
  401. ;
  402.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  403.         Macro
  404.         _HMGetBalloonWindow
  405.             move.w              #$0215,D0
  406.             dc.w                $A830
  407.         EndM
  408.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  409.         IMPORT_CFM_FUNCTION HMGetBalloonWindow
  410.     ENDIF
  411.  
  412.  
  413.  
  414.  
  415.     ENDIF ; __BALLOONS__ 
  416.  
  417.